package cn.itcast.crm.service;

import java.util.List;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;

import org.springframework.data.repository.query.Param;

import cn.itcast.crm.domain.Customer;

@Produces("*/*")
public interface CustomerService {

	
	@Path("/findbytelephone/{telephone}")
	@GET
	@Produces({"application/xml","application/json"})
	public Customer getCustomerByTelephone(@PathParam("telephone") String telephone);
	
	
	/**
	 * 查询未关联的客户
	 * @return
	 */
	
	@Path("/noassociationcustomers")
	@GET
	@Produces({"application/xml","application/json"})
	public List<Customer> getNoAssociationCustomers();
	
	
	/**
	 * 查询已关联的数据
	 */
	
	@Path("/associationfixedareacustomers/{fixedAreaId}")
	@GET
	@Produces({"application/xml","application/json"})
	public List<Customer> getAssociationCustomers(@PathParam("fixedAreaId") String fixedAreaId);
	
	/**
	 * 设置未关联的数据和定区关联起来
	 */
	@Path("/associationcustomerstofixedarea")
	@PUT
	public void setNoAssociationCustomers(
			@QueryParam("noAssociationCustomerId") String noAssociationCustomerId,@QueryParam("fixedAreaId") String fixedAreaId);
	
	@Path("/customersave")
	@POST
	@Consumes({"application/xml","application/json"})
	public void customerSave(Customer customer);
	
	@Path("/customerlogin")
	@GET
	@Produces({"application/xml","application/json"})
	public Customer login(@QueryParam("telephone") String telephone,@QueryParam("password") String password);
	
	@Path("/findFixedAreaIdByAddress")
	@GET
	@Produces({"application/xml","application/json"})
	public String findFixedAreaIdByAddress(@QueryParam("address") String address);
}
